<template>
  <div >
    <button @click='fn(-1)'>-</button>
    <span>{{value}}</span>
    <button @click='fn(1)'>+</button>
  </div>
</template>

<script>
export default {
  name: 'NumberBox',
  props:['value'],
  methods:{
    fn(num){
      this.$emit('input',this.value+num)
    }
  }
}
</script>

<style lang="less" scoped>
span {
  display: inline-block;
  margin: 0 5px;
}
</style>